import { createRouter, createWebHistory } from "vue-router";
import TaskList from "../views/TaskList.vue";

const routes = [
  {
    path: "/taskList",
    name: "TaskList",
    component: TaskList,
    children: [
      {
        path: "/taskList/dailyTask",
        name: "DailyWask",
        component: () => import("../components/DailyTask"),
      },
      {
        path: "/taskList/projectTask",
        name: "ProjectTask",
        component: () => import("../components/ProjectTask"),
      },
      {
        path: "/taskList/calendarTask",
        name: "CalendarTask",
        component: () => import("../components/CalendarTask"),
      },
      {
        path: "/taskList/allTask",
        name: "AllTask",
        component: () => import("../components/AllTask"),
      },
    ],
  },
  {
    path: "/msgCenter",
    name: "MessageCenter",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/MessageCenter.vue"),
  },
  {
    path: "/targetPlan",
    name: "TargetPlan",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/TargetPlan.vue"),
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
